package customerEnter.Frame.JDBCDao.UseQuery;

import java.sql.ResultSet;
import java.sql.ResultSetMetaData;
import java.sql.SQLException;

import customerEnter.Frame.DaoDataTransmission.DaoFramePameTransmission;
import customerEnter.Frame.JDBCDao.Interface.DaoFrameUseTypeInterface;
import customerEnter.Frame.Utils.Log4j;

public class DaoFrameUseTypeStringsImpl implements DaoFrameUseTypeInterface<String[]> {

	public <T, K> String[] useDaoFrameDataType(DaoFramePameTransmission<T, K> daoFramePameTransmission) {
		String[] strings = new String[] {};
		try {
			ResultSet sqlRowSet = daoFramePameTransmission.getRs();
			ResultSetMetaData sqlRowSetMetaData = sqlRowSet.getMetaData();
			int in = sqlRowSetMetaData.getColumnCount();
			while (sqlRowSet.next()) {
				for (int i = 1; i <= in; i++) {
					strings[i - 1] = sqlRowSet.getString(i);
				}
				break;
			}
		} catch (SQLException e) {
			Log4j.Log4JOutError(e.getMessage());
		}
		return strings;
	}
}
